from sqlalchemy import Column, DateTime, String
from sqlalchemy.ext.declarative import declarative_base

Base = declarative_base()


class UserInfo(Base):
    __tablename__ = 'UserInfo'

    user_id = Column(String(64), primary_key=True)
    user_name = Column(String(64), nullable=False)
    password = Column(String(64), nullable=False)
    identity = Column(String(32), nullable=False)


class Admin(Base):
    __tablename__ = 'admin'

    admin_id = Column(String(64), primary_key=True)
    user_id = Column(String(64), nullable=False)


class FacePicture(Base):
    __tablename__ = 'face_picture'

    face_picture_id = Column(String(64), primary_key=True)
    user_id = Column(String(64), nullable=False)
    face_picture_path = Column(String(64), nullable=False)
    upload_time = Column(DateTime)


class FaceTrainFile(Base):
    __tablename__ = 'face_train_file'

    face_train_file_id = Column(String(64), primary_key=True)
    user_id = Column(String(64), nullable=False)
    face_train_file_path = Column(String(64), nullable=False)
    upload_time = Column(DateTime)


class FaceVideoGeneration(Base):
    __tablename__ = 'face_video_generation'

    face_picture_id = Column(String(64), primary_key=True)
    video_id = Column(String(64), primary_key=True)
    ppt_file_id = Column(String(64), primary_key=True)
    generate_time = Column(DateTime, nullable=False)


class PptFile(Base):
    __tablename__ = 'ppt_file'

    ppt_file_id = Column(String(64), primary_key=True)
    user_id = Column(String(64), nullable=False)
    ppt_file_path = Column(String(64), nullable=False)
    upload_time = Column(DateTime)


class SpeechFile(Base):
    __tablename__ = 'speech_file'

    speech_file_id = Column(String(64), primary_key=True)
    user_id = Column(String(64), nullable=False)
    speech_file_path = Column(String(64), nullable=False)
    synthesis_time = Column(DateTime)


class SpeechSynthesis(Base):
    __tablename__ = 'speech_synthesis'

    ppt_file_id = Column(String(64), primary_key=True)
    speech_file_id = Column(String(64), primary_key=True)
    video_id = Column(String(64), primary_key=True)
    speech_synthesis_time = Column(DateTime, nullable=False)
    speaker_name = Column(String(64))


class SpeechTrainFile(Base):
    __tablename__ = 'speech_train_file'

    speech_train_file_id = Column(String(64), primary_key=True)
    user_id = Column(String(64), nullable=False)
    speech_train_file_path = Column(String(64), nullable=False)
    upload_time = Column(DateTime)


class Video(Base):
    __tablename__ = 'video'

    video_id = Column(String(64), primary_key=True)
    user_id = Column(String(64), nullable=False)
    video_type = Column(String(32), nullable=False)
    video_file_path = Column(String(64), nullable=False)
    upload_time = Column(DateTime)


class VideoSynthesis(Base):
    __tablename__ = 'video_synthesis'

    video_id = Column(String(64), primary_key=True)
    ppt_file_id = Column(String(64), primary_key=True)
    speech_file_id = Column(String(64), primary_key=True)
    video_synthesis = Column(DateTime, nullable=False)
